
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="/wondershare/js/jquery.js"></script> 
<script src="/wondershare/js/task.js"></script>
<script src="/wondershare/js/jquery.cvbox.min.js"></script> 
<link href="/wondershare/styles/main.css" rel="stylesheet" type="text/css" />
<link href="/wondershare/styles/general.css" rel="stylesheet" type="text/css" />
</head>
<style type="text/css">
catListTag {
	DISPLAY: none
}
.cvBoxShade {
	Z-INDEX: 2000; BACKGROUND: #ccc; LEFT: 0px; WIDTH: 100%; POSITION: absolute; TOP: 0px; HEIGHT: 0px
}
.cvBoxBorder {
	BORDER-RIGHT: #000000 0px solid; PADDING-RIGHT: 8px; BORDER-TOP: #000000 0px solid; PADDING-LEFT: 8px; FONT-SIZE: 12px; Z-INDEX: 2000; PADDING-BOTTOM: 8px; BORDER-LEFT: #000000 0px solid; WIDTH: 100%; PADDING-TOP: 8px; BORDER-BOTTOM: #000000 0px solid; POSITION: absolute; BACKGROUND-COLOR: #ccc
}
.cvBoxBorder A {
	COLOR: #486aaa; TEXT-DECORATION: none
}
.cvBoxBorder A:hover {
	COLOR: #c00; TEXT-DECORATION: none
}
.cvBoxTitleBar {
	WIDTH: 100%; LINE-HEIGHT: 27px; HEIGHT: 26px; BACKGROUND-COLOR: #eeeeee
}
.cvBoxTitleBarText {
	PADDING-LEFT: 10px; FONT-WEIGHT: bold; FLOAT: left; COLOR: #333
}
.cvBoxTitleBarClose {
	PADDING-RIGHT: 10px; FLOAT: right; COLOR: #3867af; FONT-FAMILY: Verdana
}

.cvBoxBody {
	WIDTH: 100%; BACKGROUND-COLOR: #ffffff
}

</style>
<body >
<h1>
<{if $search_array.type == 'self'}>
    <span class="action-span">
    <a href="/wondershare/task_manage.php?action=editData&type=<{$search_array.type}>">添加我的任务</a>
    </span>
    <span class="action-span1" style="color:#F00">
    我的任务
    </span>
<{elseif $search_array.type == 'test'}>
    <span class="action-span1" style="color:#F00">
    我的测试任务
    </span>
<{elseif $search_array.type == 'pub'}>
    <span class="action-span1" style="color:#F00">
    我的发布任务
    </span>
<{elseif $search_array.type == 'admin'}>
    <span class="action-span1" style="color:#F00">
    所有任务
    </span>
<{/if}>
</h1>


    <form method="GET" action="/wondershare/task_manage.php?action=index">
    <img height="22" border="0" width="26" alt="SEARCH" src="images/icon_search.gif">
    ID： <input type="text" size="5" name="mId" value="<{if $search_array.mId}><{$search_array.mId}><{/if}>">
    名称： <input type="text" size="25" name="mName" value="<{$search_array.mName|escape}>">
    
    所属网站： <select name="sId">
                <option value="" >全部</option>
                <{$site_option}>
                </select>
    <{if $search_array.type != 'self'}>
        创建人： <select name="mCreatAid">
                    <option value="">全部</option>
                   <{$user_option.mCreatAid}>
                    </select>
     <{/if}>
     
     <{if $search_array.type != 'test'}>
        测试人： <select name="mTestAid">
                    <option value="" >全部</option>
                    <{$user_option.mTestAid}>
                    </select>
    <{/if}>
    
    <{if $search_array.type != 'pub'}>
        发布人： <select name="mPubAid">
                    <option value="" >全部</option>
                    <{$user_option.mPubAid}>
                    </select>
      <{/if}>           
    <input type="submit" class="button"  name="search" value=" 搜索 ">
    <input type="hidden" name="type" id="type" value="<{$search_array.type|escape}>" />
    </form>

<table width="100%" cellspacing="1" cellpadding="2" id="list-table" class="list-div">
<tbody>
  <tr>
    <th>任务ID</th>
    <th>任务名称</th>
	<th>站点域名</th>
    <th>创建者</th>
	<th>测试者</th>
    <th>发布者</th>
    <th>当前状态</th>
    <th>文件路径</th>
    <th>编辑</th>
  </tr>
  
<{foreach from=$manage_rows item=item}>
  <tr align="center"  id="tr_<{$item.mId}>">
	<td width="5%" align="center"  >
    	<{if $item.mState == 4  ||  $item.mState == 3 }> 
	   		<input value="<{$item.mId}>" name="ID[]" type="checkbox" >
        <{/if}>
        <{$item.mId}>
	</td>
    <td width="20%" align="center"><{$item.mName|escape}></td>
	<td width="10%"><{$item.sDomainName|escape}></td>
    <td width="10%"><{$item.mCreatUser|escape}></td>
	<td width="10%"><{$item.mTestUser|escape}></td>
	<td width="10%"><{$item.mPubUser|escape}></td>
 	<td width="7%" align="center" style="color:#F00">
        <{if $item.mState == 4 }> 
        	已完成
        <{elseif $item.mState == 3 }> 
        	待发布
        <{elseif $item.mState == 2 }> 
        	测试失败
        <{elseif $item.mState == 1 }> 
        	测试中
        <{elseif $item.mState == 0 }> 
        	未测试
		<{/if}>
	</td>
     <td width="10%" align="center" >
         <a href="javascript:void(0);"  
         onclick="showFilePathBox('file_box', '<{$item.mName|escape}> 文件路径', '<{$item.mEditFile}>', '<{$item.mDeleteFile}>',
         		 '<{$item.mCdnEditFile}>', '<{$item.mCdnDeleteFile}>', '<{$item.mMsgFile}>' , '<{$item.mCdnMsgFile}>', <{$item.mId}> );">查看文件路径</a>
     </td>
     
    <td width="15%" align="center">
    <{if $item.mState == 4  &&  ($search_array.type == 'self' || $search_array.type == 'admin' ) }> 
            <a href="javascript:void(0);" onclick="deleteInfo(<{$item.mId}>, 'oneDel', 'task_manage')" >删除</a> | 
     <{/if}>
     <a href="/wondershare/task_manage.php?action=editData&mId=<{$item.mId}>&type=<{$search_array.type|escape}>" > 编辑 </a><br />
     <{if $search_array.type == 'admin'}>
        <input type="button" onclick="updateTaskState(<{$item.mId}>, 3, '<{$search_array.type|escape}>');" value="待发布" />
        <input type="button" onclick="updateTaskState(<{$item.mId}>, 4, '<{$search_array.type|escape}>');" value="已完成" />
     <{/if}>
     <{if ( $item.mState == 4  ||  $item.mState == 3 ) && ( $search_array.type == 'pub' || $search_array.type == 'admin' )}> 
            <input type="button" onclick="taskPub(<{$item.mId}>, 'single_pub', '<{$search_array.type|escape}>');" value="发布该任务" />
      <{/if}>
     </td>
  </tr>
 <{/foreach}>

  <tr>
	    <td align="center">
            <{if  $search_array.type != 'test' }> 
                <input name="checkall" value="checked" 
                onclick="v=document.getElementsByName('ID[]');if(this.checked){for(i=0;i<v.length;i++)v[i].checked=true;}else{for(i=0;i<v.length;i++)v[i].checked=false;}" 
                type="checkbox" />全选
             <{/if}>
        </td>
		<td colspan="9">
             <{if  $search_array.type != 'test'  }> 
                <input name="sub" value="发布已选" type="button"  style="margin-left:10px; margin-right:10px;" 
                onclick="taskPub(0, 'morePub', '<{$search_array.type|escape}>');" />
             <{/if}>
            <{$page_url}>  共有 <span id="total"><{$total}> </span>条记录
        </td>
	</tr>
  </tbody>
</table>
<div id="file_box" style="display: none; width: 900px; height:150px; padding: 10px;">
    <p>发布更新文件：<a href="" id="mEditFile" style="color:#F00"></a></p>
    <p>发布删除文件：<a href="" id="mDeleteFile" style="color:#F00"></a></p>
    <p>CDN推送更新文件：<a href="" id="mCdnEditFile" style="color:#F00"></a></p>
    <p>CDN推送删除文件：<a href="" id="mCdnDeleteFile" style="color:#F00"></a></p>
    <p>发布时信息日记文件：<a href="" id="mMsgFile" style="color:#F00"></a></p>
    <p>CDN推送日记文件：<a href="" id="mCdnMsgFile" style="color:#F00"></a></p> <!-- pkjueying -->
	<input type="hidden" id="href_prefix" name="href_prefix" value="/wondershare/task_manage.php?action=showFileList&&type=<{$search_array.type|escape}>&file_name=" />
</div>
<script>
//显示多文件对话框
function showFilePathBox() {

	var href_prefix = $("#href_prefix").val();
	$("#"+arguments[0]).show();
	if (arguments[2] != '') {
	
		 $("#mEditFile").attr('href', href_prefix+arguments[2]+"&is_cdn=0&mId="+arguments[8]);
		 $("#mEditFile").html(arguments[2]);
	}
	
	if (arguments[3] != '') {
	
		 $("#mDeleteFile").attr('href', href_prefix+arguments[3]+"&is_cdn=0&mId="+arguments[8]);
		 $("#mDeleteFile").html(arguments[3]);
	}
	
	if (arguments[4] != '') {
	
		 $("#mCdnEditFile").attr('href', href_prefix+arguments[4]+"&is_cdn=1&mId="+arguments[8]);
		 $("#mCdnEditFile").html(arguments[4]);
	}
	
	if (arguments[5] != '') {
	
		 $("#mCdnDeleteFile").attr('href', href_prefix+arguments[5]+"&is_cdn=1&mId="+arguments[8]);
		 $("#mCdnDeleteFile").html(arguments[5]);
	}
	if (arguments[6] != '') {
	
		 $("#mMsgFile").attr('href', href_prefix+arguments[6]+"&is_cdn=0&is_msg=1&mId="+arguments[8]);
		 $("#mMsgFile").html(arguments[6]);
	}
	if (arguments[7] != '') {  //pkjueying
		
		 $("#mCdnMsgFile").attr('href', href_prefix+arguments[7]+"&is_cdn=0&is_msg=1&mId="+arguments[8]);
		 $("#mCdnMsgFile").html(arguments[7]);
	}
	
	$("#"+arguments[0]).cvbox({
		titleBarText: arguments[1]
	});
 


}
</script>
</body>
</html>